home *** CD-ROM | disk | FTP | other *** search
/ Programming Microsoft Visual Basic .NET / Programming Microsoft Visual Basic .NET (Microsoft Press)(X08-78517)(2002).bin / 17 controls / controlsdemo / splitterform.vb < prev    next >
Encoding:
Text File  |  2002-03-16  |  5.2 KB  |  127 lines

  1. Public Class SplitterForm
  2.     Inherits System.Windows.Forms.Form
  3.  
  4. #Region " Windows Form Designer generated code "
  5.  
  6.     Public Sub New()
  7.         MyBase.New()
  8.  
  9.         'This call is required by the Windows Form Designer.
  10.         InitializeComponent()
  11.  
  12.         'Add any initialization after the InitializeComponent() call
  13.  
  14.     End Sub
  15.  
  16.     'Form overrides dispose to clean up the component list.
  17.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  18.         If disposing Then
  19.             If Not (components Is Nothing) Then
  20.                 components.Dispose()
  21.             End If
  22.         End If
  23.         MyBase.Dispose(disposing)
  24.     End Sub
  25.     Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
  26.     Friend WithEvents Splitter1 As System.Windows.Forms.Splitter
  27.     Friend WithEvents Splitter2 As System.Windows.Forms.Splitter
  28.     Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
  29.     Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
  30.  
  31.     'Required by the Windows Form Designer
  32.     Private components As System.ComponentModel.Container
  33.  
  34.     'NOTE: The following procedure is required by the Windows Form Designer
  35.     'It can be modified using the Windows Form Designer.  
  36.     'Do not modify it using the code editor.
  37.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  38.         Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(SplitterForm))
  39.         Me.ListBox1 = New System.Windows.Forms.ListBox()
  40.         Me.Splitter1 = New System.Windows.Forms.Splitter()
  41.         Me.Splitter2 = New System.Windows.Forms.Splitter()
  42.         Me.TextBox1 = New System.Windows.Forms.TextBox()
  43.         Me.PictureBox1 = New System.Windows.Forms.PictureBox()
  44.         Me.SuspendLayout()
  45.         '
  46.         'ListBox1
  47.         '
  48.         Me.ListBox1.Dock = System.Windows.Forms.DockStyle.Left
  49.         Me.ListBox1.ItemHeight = 18
  50.         Me.ListBox1.Name = "ListBox1"
  51.         Me.ListBox1.Size = New System.Drawing.Size(176, 400)
  52.         Me.ListBox1.TabIndex = 0
  53.         '
  54.         'Splitter1
  55.         '
  56.         Me.Splitter1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
  57.         Me.Splitter1.Location = New System.Drawing.Point(176, 0)
  58.         Me.Splitter1.MinExtra = 200
  59.         Me.Splitter1.MinSize = 100
  60.         Me.Splitter1.Name = "Splitter1"
  61.         Me.Splitter1.Size = New System.Drawing.Size(8, 413)
  62.         Me.Splitter1.TabIndex = 1
  63.         Me.Splitter1.TabStop = False
  64.         '
  65.         'Splitter2
  66.         '
  67.         Me.Splitter2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
  68.         Me.Splitter2.Dock = System.Windows.Forms.DockStyle.Bottom
  69.         Me.Splitter2.Location = New System.Drawing.Point(184, 117)
  70.         Me.Splitter2.Name = "Splitter2"
  71.         Me.Splitter2.Size = New System.Drawing.Size(456, 8)
  72.         Me.Splitter2.TabIndex = 3
  73.         Me.Splitter2.TabStop = False
  74.         '
  75.         'TextBox1
  76.         '
  77.         Me.TextBox1.Dock = System.Windows.Forms.DockStyle.Fill
  78.         Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 13.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  79.         Me.TextBox1.Location = New System.Drawing.Point(184, 0)
  80.         Me.TextBox1.Multiline = True
  81.         Me.TextBox1.Name = "TextBox1"
  82.         Me.TextBox1.Size = New System.Drawing.Size(456, 117)
  83.         Me.TextBox1.TabIndex = 4
  84.         Me.TextBox1.Text = "TextBox1"
  85.         '
  86.         'PictureBox1
  87.         '
  88.         Me.PictureBox1.Dock = System.Windows.Forms.DockStyle.Bottom
  89.         Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Bitmap)
  90.         Me.PictureBox1.Location = New System.Drawing.Point(184, 125)
  91.         Me.PictureBox1.Name = "PictureBox1"
  92.         Me.PictureBox1.Size = New System.Drawing.Size(456, 288)
  93.         Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
  94.         Me.PictureBox1.TabIndex = 2
  95.         Me.PictureBox1.TabStop = False
  96.         '
  97.         'SplitterForm
  98.         '
  99.         Me.AutoScaleBaseSize = New System.Drawing.Size(7, 17)
  100.         Me.BackColor = System.Drawing.SystemColors.ActiveBorder
  101.         Me.ClientSize = New System.Drawing.Size(640, 413)
  102.         Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TextBox1, Me.Splitter2, Me.PictureBox1, Me.Splitter1, Me.ListBox1})
  103.         Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  104.         Me.Name = "SplitterForm"
  105.         Me.Text = "SplitterForm"
  106.         Me.ResumeLayout(False)
  107.  
  108.     End Sub
  109.  
  110. #End Region
  111.  
  112.     ' load random items in the ListBox when the form loads
  113.  
  114.     Private Sub SplitterForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  115.         Dim i As Integer
  116.         For i = 1 To 100
  117.             ListBox1.Items.Add("Item #" & CStr(i))
  118.         Next
  119.     End Sub
  120.  
  121.     ' Show splitter bar in debug window when the user moves it
  122.  
  123.     Private Sub Splitter1_Move(ByVal sender As Object, ByVal e As System.EventArgs) Handles Splitter1.Move
  124.         Debug.WriteLine(Splitter1.SplitPosition)
  125.     End Sub
  126. End Class
  127.